import request from '/@/utils/request';

/**
 * OIDC 作用域管理 API
 */

// 获取作用域列表
export function getScopeList(params: any) {
  return request({
    url: '/oidc/admin/scopes',
    method: 'get',
    params,
  });
}

// 创建作用域
export function createScope(data: any) {
  return request({
    url: '/oidc/admin/scope',
    method: 'post',
    data,
  });
}

// 获取作用域详情
export function getScopeDetail(scopeId: string) {
  return request({
    url: `/oidc/admin/scope`,
    method: 'get',
    params: {
      id: scopeId,
    },
  });
}

// 更新作用域
export function updateScope(scopeId: string, data: any) {
  return request({
    url: `/oidc/admin/scope`,
    method: 'put',
    params: {
      id: scopeId,
    },
    data,
  });
}

// 删除作用域
export function deleteScope(scopeId: string) {
  return request({
    url: `/oidc/admin/scope`,
    method: 'delete',
    params: {
      id: scopeId,
    },
  });
}

//  获取作用域选项
export function getScopeOptions() {
  return request({
    url: `/oidc/admin/scope/options`,
    method: 'get',
  });
}
